// pages/person-detail/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    tabBars: ["代码", "盈亏", "持仓", '成本/现价'],
    stockList: [{
      stockName: "宁德时代",
      profitOrLoss: "20%",
      position: "29%",
      costAndCPrice: "17.00/34.00"
    }, {
      stockName: "正邦科技",
      profitOrLoss: "20%",
      position: "29%",
      costAndCPrice: "17.00/34.00"
    }, {
      stockName: "牧原股份",
      profitOrLoss: "20%",
      position: "29%",
      costAndCPrice: "17.00/34.00"
    }, {
      stockName: "漫步者",
      profitOrLoss: "20%",
      position: "29%",
      costAndCPrice: "17.00/34.00"
    }, {
      stockName: "京沪高铁",
      profitOrLoss: "20%",
      position: "29%",
      costAndCPrice: "17.00/34.00"
    }]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    console.log(options)
    wx.setNavigationBarTitle({
      title: options.name ? options.name + '持仓详情' : '持仓详情'
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  },

  /**
   * 去操作详情页面 需要携带股票代码code
   */
  toOperationDetail:function(event){
    var stock = event.detail;
    wx.navigateTo({
      url: '/pages/stock-operation-detail/index?stockCode=xxxx',
    })
  }
})